package com.doctor.ui.consulting.ConsultationMenu.view;

import android.view.View;
import android.widget.TextView;

import com.doctor.base.BaseFragment;
import com.doctor.constants.CodeHelper;
import com.doctor.ui.R;
import com.doctor.utils.callback.DataChangedListener;

/**
 * 会诊列表界面
 * Created by chemin on 2017/3/12 17:18.
 */

public class ConsultationMenuFrag extends BaseFragment implements View.OnClickListener {
    private TextView mTvConsultation;
    private DataChangedListener mListener;
    private TextView mTvCardRecord;


    public void setDatachangListener(DataChangedListener listener){
        this.mListener=listener;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_consultation_menu_layout;
    }

    @Override
    protected void initView(View view) {
        mTvCardRecord = (TextView) view.findViewById(R.id.element_tv_card_record);
        mTvConsultation = (TextView) view.findViewById(R.id.element_tv_consultation_menu);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void addListener() {
        mTvConsultation.setOnClickListener(this);
        mTvCardRecord.setOnClickListener(this);


    }

    @Override
    protected void setData() {

    }


    @Override
    public void onClick(View v) {
        if (v != null) {
            switch (v.getId()) {
                case R.id.element_tv_card_record://跳转到会诊单记录界面
                    if (mListener!=null){
                        mListener.dataChanged(CodeHelper.CONSULTATION_CARD_RECORD_FRAGMENT,null);
                    }
                    break;
                case R.id.element_tv_consultation_menu://跳转到会诊列表
                    if (mListener!=null){
                        mListener.dataChanged(CodeHelper.CONSULTATION_MENU,null);
                    }
                    break;
            }
        }
    }

}
